Skip to content

Conversation

Joel-Kornbluh
Copy link

@Joel-Kornbluh Joel-Kornbluh commented Mar 3, 2023

The PR significantly improves rendering performance of the choice drop-down by changing how we're displaying the "none" option.

Whereas before we used to add a special "none" option to the items list which we were then testing for in the template for each rendered item (using a switch/case), we're now instead adding a single "none" option statically in the template which is displayed/activated/disabled when needed, thus removing the need for expensive DOM checks in each rendered item.

The screenshots below are comparing the rendering performance of a drop-down with 366 visible items. The initial crest is when the user clicked on the drop-down menu. It ends when the drop-down is rendered on screen. Each test was done twice.

Legacy Implementation
legacy_dropdown_performance_chart

Optimized Implementation
improved_dropdown_performance_chart

@Joel-Kornbluh Joel-Kornbluh force-pushed the VIV-9227/performance branch 3 times, most recently from 0be0971 to 1461747 Compare March 3, 2023 16:14
@Joel-Kornbluh Joel-Kornbluh force-pushed the VIV-9227/performance branch from 1461747 to 6ac3946 Compare March 3, 2023 20:07
@Joel-Kornbluh Joel-Kornbluh merged commit 2e0cb5c into master Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants